<template>
  <div>
    <div class="banner" @click="handleGalleryShow">
      <img class="banner-img" :src="bannerImg" />
      <div class="banner-info">
        <div class="banner-number">
          <span class="iconfont back-icon">&#xe633;</span>
          {{gallaryImgs.length}}
        </div>
        <div class="banner-tittle">
          {{signtName}}
        </div>
      </div>
    </div>
    <fade-animation>
      <detail-gallery
       :imgs="gallaryImgs"
        v-show="galleryShow"
        @chege="handleGalleryClose"
        ></detail-gallery>
    </fade-animation>
  </div>
</template>

<script>
import DetailGallery from 'gallery/Gallery'
import FadeAnimation from 'common/fade/FadeAnimation'

export default {
  name: 'Detail',
  props: ['gallaryImgs', 'bannerImg', 'signtName'],
  data () {
    return {
      galleryShow: false
    }
  },
  methods: {
    handleGalleryShow () {
      this.galleryShow = true
    },
    handleGalleryClose () {
      this.galleryShow = false
    }
  },
  components: {
    DetailGallery,
    FadeAnimation
  }
}

</script>

<style lang="stylus" scoped>
 .banner
  position: relative
  height: 0
  padding-bottom: 55%
  .banner-img
    width: 100%
  .banner-info
    display: flex
    position: absolute
    right: 0
    bottom: 0
    left: 0
    line-height: .6rem
    color: #fff
    background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8))
    .banner-tittle
      position: relative
      bottom: .2rem
      left: .2rem
      font-size: .34rem
      height: .4rem
      line-height: .4rem
    .banner-number
      position: absolute;
      bottom: .76rem;
      left: .2rem
      font-size: .24rem
      width: 1.2rem;
      height: .4rem;
      line-height: .4rem
      text-align: center
      background: rgba(0,0,0,.5)
      border-radius: .2rem
      .back-icon
        font-size: .24rem
</style>
